2 using System.Collections.Generic;
5 using Microsoft.Xna.Framework;
6 using Microsoft.Xna.Framework.Graphics;
7 using Microsoft.Xna.Framework.Content;
9 namespace SuperPolarity
11 static class ActorFactory
13 static internal Game Game;
15 static public MainShip CreateMainShip(Vector2 position)
17 MainShip mainShip = new MainShip(Game);
18 mainShip.Initialize(Game.Content.Load<Texture2D>("Graphics\\main-ship"), position);
20 ActorManager.CheckIn(mainShip);
25 static public StandardShip CreateShip(Ship.Polarity polarity, Vector2 position)
27 StandardShip ship = new StandardShip(Game);
30 if (polarity == Ship.Polarity.Positive)
32 texture = Game.Content.Load<Texture2D>("Graphics\\positive-ship");
34 else if (polarity == Ship.Polarity.Negative)
36 texture = Game.Content.Load<Texture2D>("Graphics\\negative-ship");
40 texture = Game.Content.Load<Texture2D>("Graphics\\neutral-ship");
43 ship.Initialize(texture, position);
44 ship.SetPolarity(polarity);
46 ActorManager.CheckIn(ship);
51 internal static void SetGame(Game game)
53 ActorFactory.Game = game;
56 internal static Bullet CreateBullet(Vector2 position, float angle)
58 Bullet bullet = new Bullet(Game);
60 bullet.Initialize(Game.Content.Load<Texture2D>("Graphics\\square"), position);
64 ActorManager.CheckIn(bullet);